package com.s3.khospitalds.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.s3.khospitalds.entity.Complaininfo;
import com.s3.khospitalds.mapper.ComplaininfoMapper;
import com.s3.khospitalds.service.ComplaininfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: xw
 * @CreateTime: 2025/2/20
 * @Description: 投诉类
 * @Version: 1.0
 */
@Service
public class ComplaininfoServiceImpl extends ServiceImpl<ComplaininfoMapper, Complaininfo> implements ComplaininfoService {
    @Autowired
    ComplaininfoMapper complaininfoMapper;
    @Override
    public List<Complaininfo> selectComplaininfo() {
        return complaininfoMapper.selectList(null);
    }

    @Override
    public int insertComplaininfo(Complaininfo complaininfo) {
        return complaininfoMapper.insert(complaininfo);
    }

    @Override
    public int updateComplaininfo(String textarea, int id) {
        return complaininfoMapper.updateByReply(textarea, id);
    }

    @Override
    public int deleteComplaininfo(int id) {
        return complaininfoMapper.deleteById(id);
    }
}
